package com.nashuju.web.controller.article;

import java.util.HashMap;

import org.durcframework.core.GridResult;
import org.durcframework.core.MessageResult;
import org.durcframework.core.controller.CrudController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nashuju.web.entity.article.ArticleExtend;
import com.nashuju.web.entity.article.ArticleExtendSch;
import com.nashuju.web.service.article.ArticleExtendService;

@Controller
public class ArticleExtendController extends CrudController<ArticleExtend, ArticleExtendService> {

    @RequestMapping("/addCArticleExtend.do")
    public @ResponseBody MessageResult addCArticleExtend(ArticleExtend entity) {
        return this.save(entity);
    }

    @RequestMapping("/listCArticleExtend.do")
    public @ResponseBody GridResult listCArticleExtend(ArticleExtendSch searchEntity) {
        return this.query(searchEntity);
    }

    @RequestMapping("/updateCArticleExtend.do")
    public @ResponseBody MessageResult updateCArticleExtend(ArticleExtend entity) {
        return this.update(entity);
    }

    @RequestMapping("/delCArticleExtend.do")
    public @ResponseBody MessageResult delCArticleExtend(ArticleExtend entity) {
        return this.delete(entity);
    }

    @RequestMapping("/getCArticleExtendById.do")
    public @ResponseBody ArticleExtend getCArticleExtendById(ArticleExtend entity) {
        return this.getService().get(entity.getId());
    }

    @RequestMapping("/findCArticleExtendByAbId.do")
    public @ResponseBody HashMap<String, String> findCArticleExtendByAbId(int abId) {
        return this.getService().findABExtByabId(abId);
    }

    @RequestMapping("/findABExtCheckboxByabIdAndCellname.do")
    public @ResponseBody ArticleExtend findABExtCheckboxByabIdAndCellname(int abId, String cellname) {
        return this.getService().findABExtCheckboxByabIdAndCellname(abId, cellname);
    }

}
